#ifndef _WDS_PICKUP_H_
#define _WDS_PICKUP_H_

#include "ui/ui_manager.h"

class WDSSfx;


class WDSPickup
{
public:

	enum PICKUP_TYPES
	{
		PICKUP_TYPE_NONE,	

		PICKUP_TYPE_1UP,
		PICKUP_TYPE_STAR,

		PICKUP_TYPE_HEALTH,	
		PICKUP_TYPE_SHIELD,
		PICKUP_TYPE_NUKE,			
		PICKUP_TYPE_FIREBLAST,		
		PICKUP_TYPE_FIREBULLETS,		
		PICKUP_TYPE_FLASHSTEP,
		PICKUP_TYPE_FREEZE,
		PICKUP_TYPE_MOVESPEED,		
		PICKUP_TYPE_WEAPONSPEED,

		PICKUP_TYPE_GUNSTART,
		//-------------------------
		PICKUP_TYPE_ASSAULTRIFLE,
		PICKUP_TYPE_SHOTGUN,
		PICKUP_TYPE_SAWEDOFFSHOTGUN,
		PICKUP_TYPE_SUBMACHINEGUN,
		PICKUP_TYPE_JACKHUMMER,
		PICKUP_TYPE_MEANMINIGUN,

		PICKUP_TYPE_GAUSSGUN,
		PICKUP_TYPE_GAUSSSHOTGUN,

		PICKUP_TYPE_FLAMETHROWER,

		PICKUP_TYPE_PULSEGUN,

		PICKUP_TYPE_PLASMARIFLE,
		PICKUP_TYPE_MULTIPLASMAGUN,
		PICKUP_TYPE_PLASMAMINIGUN,
		PICKUP_TYPE_PLASMASHOTGUN,
		PICKUP_TYPE_PLASMACANNON,

		PICKUP_TYPE_ROCKETLAUNCHER,
		PICKUP_TYPE_SEEKERROCKET,
		PICKUP_TYPE_MINIROCKETSWARMER,
		PICKUP_TYPE_ROCKETMINIGUN,
				
		PICKUP_TYPE_IONRIFLE,
		PICKUP_TYPE_IONMINIGUN,
		PICKUP_TYPE_IONCANNON,
		PICKUP_TYPE_IONSHOTGUN,
		//-------------------------
		PICKUP_TYPE_GUNEND,
		
		PICKUP_COUNT
	};

	enum	PICKUP_ANIMATION_STATE
	{		
		PICKUP_ANIMATION_STATE_NONE,
		PICKUP_ANIMATION_STATE_GOINGSMALL,
		PICKUP_ANIMATION_GOINGBIG,
		PICKUP_ANIMATION_STATE_APPEAR_START,
		PICKUP_ANIMATION_STATE_APPEAR,
		PICKUP_ANIMATION_STATE_DISAPPEAR_START,
		PICKUP_ANIMATION_STATE_DISAPPEAR,
		PICKUP_ANIMATION_STATE_C,

	};
	

	WDSPickup(WDSPickup::PICKUP_TYPES Type, const math::Vec2& P);


	virtual void				Render(const math::Vec2& Offset, float Scale);
	virtual void				RenderDebug(const math::Vec2& Offset, float Scale);
	virtual void				Tick(float dt);	
	virtual void				ReSpawn();
	virtual void				RenderShadow(const math::Vec2& Offset, float Scale);

	virtual void				OnDie();
	PICKUP_TYPES				HitTest(const math::Vec2& P, float Radius,  float Scale);

	void						Clear();	
	bool						IsAlive() const { return m_IsAlive; }; 	
	const math::Vec2&			GetPos() const  { return m_Pos; };
	float						GetRotation() const { return m_Rotation; };	
	bool						IsInSideScreen();
	
	static PICKUP_TYPES			MapNameToType(const std::string& Name);
	static std::string			MapTypeToName(PICKUP_TYPES Type);

	static std::string			GetSpriteFile1(PICKUP_TYPES Type);
	static std::string			GetSpriteFile2(PICKUP_TYPES Type);
	PICKUP_TYPES				GetType() const { return m_Type; };
	

protected:          

	void						HitTest();
	void						LoadSprite();
	void						Load(const std::string& Name,const std::string& Glow);
	void						GotEaten();	

	WDSPickup::PICKUP_TYPES		m_Type;

	bool						m_IsAlive;
	math::Vec2					m_Pos;	
	float						m_Duration;

	ui::UISprite				m_pSprite;	
	float						m_Radius;	
	float						m_Rotation;	
	float						m_Scale;
	
	ui::UISprite				m_Sprite;	

  	PICKUP_ANIMATION_STATE		m_AnimationState;
	float						m_SpawnMovementDegree;
	float						m_SpawnMovementTime;
	WDSSfx*						m_pSFX;
	float						m_RotationSpeed;

};

#endif